library test;
uses
  SysUtils,
  Windows;
type
  TKernelInfo = record
    TextInsert,
    TextFind,
    SetPos,
    GetPos,
    TextDelete,
    PutPixel,
    GetPixel,
    DrawRect,
    InsertButton,
    CreateTab,
    FindTab:Pointer;
    DC:HDC;
    Item:integer;
  end;
  PKernelInfo=^TKernelInfo;
Var
  Info:PKernelInfo;
  TextInsert:   function(pos:integer;str:pchar):integer; stdcall;
  TextFind:     function(pos:integer;str:pchar):integer; stdcall;
  SetPos:       function(pos:integer):integer; stdcall;
  GetPos:       function:integer; stdcall;
  TextDelete:   function(start_line,end_line:integer):integer; stdcall;
  PutPixel:     function(item,x,y,color:integer):integer; stdcall;
  GetPixel:     function(item,x,y:integer):integer; stdcall;
  DrawRect:     function(item,x1,y1,x2,y2,color:integer):integer; stdcall;
  InsertButton: function(tab,filepict,text,alt:pchar; OClick:Pointer):integer; stdcall;
  CreateTab:    function(name:pchar):integer; stdcall;
  FindTab:      function(name:pchar):integer; stdcall;
procedure OClick;
begin
  MessageBox(0,'OClick','Title',0);
end;
function Init(KInfo:PKernelInfo):integer;stdcall;
var tmp,tmp2:pointer;
    mystr:pchar;
    a,t,f,tab:pchar;
begin
 TextInsert:=  KInfo^.TextInsert;
 TextFind:=    KInfo^.TextFind;
 SetPos:=      KInfo^.SetPos;
 GetPos:=      KInfo^.GetPos;
 TextDelete:=  KInfo^.TextDelete;
 PutPixel:=    KInfo^.PutPixel;
 GetPixel:=    KInfo^.GetPixel;
 DrawRect:=    KInfo^.DrawRect;
 InsertButton:=KInfo^.InsertButton;
 CreateTab:=   KInfo^.CreateTab;
 FindTab:=     KInfo^.FindTab;

 CreateTab('Standard');
 CreateTab('Additional');
 InsertButton('Standard','1','2','3',@OClick);
end;

function Draw:integer;stdcall;
begin
end;
exports
   Init,
   Draw;
begin
end.
